package com.zh.proxymode;

import com.zh.proxymode.services.dynamicproxy.*;
import com.zh.proxymode.services.dynamicproxy.impl.BiBi;
import com.zh.proxymode.services.dynamicproxy.impl.DiDi;
import com.zh.proxymode.services.dynamicproxy.impl.HouseOfHanMeimei;
import com.zh.proxymode.services.dynamicproxy.impl.HouseOfLilei;

public class DynamicApplication {

//    public static void main(String[] args) {
//        Taxi taxiBibi = (Taxi) new CallPlatform().getInstance(new BiBi());
//        taxiBibi.Call();
//
//        Taxi taxiDidi = (Taxi) new CallPlatform().getInstance(new DiDi());
//        taxiDidi.Call();
//    }

    public static void main(String[] args) {
        DynamicHouse houseOfLilei = (DynamicHouse) new DynamicIntermediary().getInstance(new HouseOfLilei());
        houseOfLilei.Sell();

        DynamicHouse houseOfHanMeimei = (DynamicHouse) new DynamicIntermediary().getInstance(new HouseOfHanMeimei());
        houseOfHanMeimei.Sell();

        DynamicHouse houseOfLileiCGLib = (DynamicHouse) new CGLibIntermediary().getInstance(HouseOfLilei.class);
        houseOfLileiCGLib.Sell();
    }
}
